import request from '@/utils/request.js'

// 添加分类
export function addCategory(categoryAndStandard) {
    return request.post('/category/addCategoryAndStandard', categoryAndStandard);
}

// 修改分类和规格
export function updateCategory(category, categoryId) {
    return request.put(`/category/updateCategory/${categoryId}`, category);
}

// 删除分类
export function deleteCategories(categoryIdList) {
    return request.delete('/category/delete', {data: categoryIdList});
}

// 根据时间查询分类
export function getCategory(current, num) {
    return request.get(`/category/getCategory/${current}/${num}`);
}

// 模糊查询分类
export function getCategoryByName(current, num, ParentName, childName) {
    return request.get(`/category/getCategoryByName/${current}/${num}`, {params: {ParentName, childName}});
}
